(function(window){
	var ajaxUrl = "http://192.168.100.35:8099";

	/* 判断是否登录 */
	if(sessionStorage.getItem("userName")){

		var maxim = JSON.parse(sessionStorage.getItem("maxim"));

		if(maxim && maxim.auth_Name){
			$(".home div").html(maxim.motto_Content);
			$(".home .baike").html(maxim.auth_Name).prop("href", maxim.baike_Url);
		}else{
			$(".home div").html("hello world");
			$(".home .baike").html("佚名").prop("target", "");
		}

		/* 注销 */
		$(".logout").click(function(){
			if(confirm("您确定注销吗？")){
				sessionStorage.setItem("userName", "");
				sessionStorage.setItem("userRole", "");

				window.location.href = "../index.html";
			}
		});
	}else{

		window.location.href = "../index.html";
	}
})(window);